package com.sg.dto.integration.component;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @desc ImpowerTargetObjBizTypeDto
 * @使用场景
 */
@Data
public class ImpowerTargetObjBizTypeDto
        extends BaseDto
        implements Serializable {

    /**
     * 指标业务类型标识
     */
    @ApiModelProperty("指标业务类型标识")
    private String objectiveValueTypeCode;

    /**
     * 指标业务类型名称
     */
    @ApiModelProperty("指标业务类型名称")
    private String objectiveValueTypeName;

    /**
     * 答案值
     */
    @NotNull(message = "答案值不能为空")
    @ApiModelProperty("答案值")
    private String endValue;

    /**
     * 选项名称
     */
    @NotNull(message = "选项名称不能为空")
    @ApiModelProperty("选项名称")
    private String confOptionName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        ImpowerTargetObjBizTypeDto that = (ImpowerTargetObjBizTypeDto) o;
        return (
                objectiveValueTypeCode == that.objectiveValueTypeCode &&
                        objectiveValueTypeName == that.objectiveValueTypeName &&
                        endValue == that.endValue &&
                        confOptionName == that.confOptionName
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                objectiveValueTypeCode,
                objectiveValueTypeName,
                endValue,
                confOptionName
        );
    }

}
